<style>
    .checkoutform .panel{box-shadow:none;}
     #member_position .alert{margin:5px;}
    .lh34{line-height:34px;}
    .lrpd{padding-left:0;padding-right:0}
</style>
  <section class="panel">
    <header class="panel-heading custom-tab dark-tab">
      <ul class="nav nav-tabs">
        <li class="active"> <a href="#home2" data-toggle="tab">基本信息</a> </li>
        <!--<li class=""> <a href="#about2" data-toggle="tab">辅助信息</a> </li>-->
        <!--<li class=""> <a href="#about3" data-toggle="tab">权限分配</a> </li>-->
      </ul>
    </header>
    <div class="panel-body">
      <div class="tab-content">
        <div class="tab-pane active" id="home2">
            <form role="form" method="post" action="{:U('insert')}" class="checkoutform" style="background:#fff;" id="addemployee">
                <input type='hidden' name='member_position_id' >
          <div   data-position="left" data-intro="填写基本信息">
          <div class="row">
            <div class="col-sm-6 lh34">
                <div class="col-sm-3 lrpd">姓名：</div>
                <div class="form-group text-input col-sm-4 lrpd">
                    <input name="name" class="form-control" id="name" type="text" placeholder="姓名" datatype="*" nullmsg="姓名不能为空" errormsg="输入限制为文本" value="{$info.name}"/>
                </div>
            </div>
            <div class="col-sm-6" style="float:right;">
                <div class="col-sm-3 lrpd" style="line-height: 42px;">性别：</div>
                <div class="icheck">
                    <div style="display:inline-block;">
                        <div class="radio square-red single-row">
                            <input type="radio" value="1" checked name="sex">
                            <label>男</label>
                        </div>
                    </div>
                    <div style="display:inline-block;">
                        <div class="radio square-red single-row">
                            <input type="radio" value="0" name="sex">
                            <label>女</label>
                        </div>
                    </div>
                </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6 lh34">
                <div class="col-sm-3 lrpd">电话：</div>
              <div class="form-group text-input col-sm-8 lrpd">
                <input name="tel" class="form-control" datatype="m" placeholder="电话" id="tel" type="text" value="{$info.tel}"/>
              </div>
            </div>
              <div class="col-sm-6 lh34" style="float:left">
                  <div class="col-sm-3 lrpd">邮箱：</div>
                  <div class="form-group text-input col-sm-8 lrpd">
                      <input class="form-control" datatype="e" id="Email" name="Email" placeholder="邮箱" value=""  autocomplete="off"  type="text">
                  </div>
              </div>
          </div>
          <div class="row">
              <div class="col-sm-6 lh34">
                  <div class="col-sm-3 lrpd">密码：</div>
                  <div class="form-group text-input col-sm-8 lrpd">
                      <input class="form-control" datatype="*6-18" id="password" name="password" placeholder="初始密码" value=""  type="text" onfocus="this.type='password'">
                  </div>
              </div>
              <div class="col-sm-6 lh34" style="float:left">
                  <div class="col-sm-3 lrpd">工号：</div>
                  <div class="form-group text-input col-sm-8 lrpd">
                      <input class="form-control" datatype="*" id="company_id" name="company_id" placeholder="工号" value=""  autocomplete="off"  type="text">
                  </div>
              </div>
          </div>
        </div>
        <div class="row" data-position="left" data-intro="为员工分配权限">
          <div class="form-group">
            <div class="panel">
              <header class="panel-heading"> 请勾选一个角色 </header>
              <div class="panel-body">
                <volist name="role_list" id="vo">
                  <?php $deep = $role_list[$key - 1]['cl']; if($deep != $vo['cl']){?>
                  <br>
                  <?php }?>
                  <div class="icheck" style="display:inline-block;">
                    <div class="square-red single-row">
                        <input <?php if($vo['id']==$info['group_id']):?>checked<?php endif; ?> type="radio" name="role_id[]" value="{$vo.id}" id="is_nav_2" />
                        <label>{$vo.title}</label>
                    </div>
                  </div>
                </volist>
              </div>
            </div>
          </div>
          <!--<div class="form-group">-->
            <!--<div class="panel">-->
              <!--<header class="panel-heading"> 选择部门/职位 </header>-->
              <!--<div class="panel-body">-->
                <!--<div id="member_position">-->
                  <!--<volist name="memberpostion" id="vo">-->
                    <!--<div id="member_position_id{$vo.id}" class="alert alert-info fade in" style="display:inline-block; padding:5px;">-->
                      <!--<button type="button" class="close close-sm" data-dismiss="alert"> <i class="fa icon-times"></i> </button>-->
                      <!--<strong>-->
                      <!--<input type="hidden" value="{$vo.id}" name="member_position_id[]">-->
                      <!--{$vo.name}</strong> </div>-->
                  <!--</volist>-->
                <!--</div>-->
                <!--<div id="FlatTree1" class="tree tree-plus-minus">-->
                  <!--<div class = "tree-folder" style="display:none;">-->
                    <!--<div class="tree-folder-header"> <i class="fa fa-folder"></i>-->
                      <!--<div class="tree-folder-name"></div>-->
                    <!--</div>-->
                    <!--<div class="tree-folder-content"></div>-->
                    <!--<div class="tree-loader" style="display:none"></div>-->
                  <!--</div>-->
                  <!--<div class="tree-item" style="display:none;"> <i class="tree-dot"></i>-->
                    <!--<div class="tree-item-name"></div>-->
                  <!--</div>-->
                <!--</div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
          </div>
            </form>
            <div class="panel row"  data-position="left" data-intro="选择部门">
                <header class="panel-heading"> 选择部门/职位</header>
                <div class="panel-body">
                    <html:dropdownselect class="employeeselect" listloaded="listloadedlistloaded" selected="" name="employee" style="height:auto; width:300px;" multi="0" action="{:U('Team/positionlist')}" title="选择部门" placeholder="点击选择部门"/>
                    <style>
                        .selectlist{margin:0; padding:0;}
                        .selectlist ul{padding:0}
                        .selectlist li{list-style-type:none; margin:0; padding:0;padding:5px; border-bottom:1px solid #eee; margin:0 8px;}
                        .selectlist li:hover{background:#eee;}
                    </style>
                    <div id="reselectemployeelayout" style="top:0; display:none; left:0; bottom:0; right:0; position:fixed; z-index:9999999;"></div>
                </div>
            </div>
        </div>
      </div>
    </div>
  </section>
</form>
<script>
    function listloadedlistloaded(){
        $('.employeeselect').blur(function(){
            $("#addemployee input[name='member_position_id']").remove();
            $('.employeeselect.binded .itemspan').each(function(){
                $('#addemployee').append("<input type='hidden' name='member_position_id' value='"+$(this).children("input:eq(1)").attr('value')+"'>");
            });
        });
    }
    jQuery(document).ready(function() {
        $.post("{:U('Taskform/getform',array('id'=>$newform))}",function(data){ $('#thisrow').html(data.tbody);$('#newform').val(data.tbody);$('#f-form').nextAll().remove(); checkbox();},'json');
        function checkbox(){
            //表单修改后将之写入隐藏input
            $("#thisrow input[type='checkbox']").each(function(){
                $(this).click(function(){
                    if($(this).attr('checked')=='checked'){
                        $(this).attr('checked','checked');
                    }else {
                        $(this).removeAttr('checked');
                    }
                    $('#newform').val($('#thisrow').html());
                })
            });
            $("#thisrow input[type='radio']").each(function(){
                $(this).click(function(){
                    if($(this).attr('checked')=='checked'){
                        $(this).attr('checked','checked');
                    }else {
                        $(this).removeAttr('checked');
                    }
                    $('#newform').val($('#thisrow').html());
                })
            });
        }
    });
    $(window).trigger('load');
</script>
